import Taro, { Component } from '@tarojs/taro'
import { Image, Text, View } from '@tarojs/components'
import './index.scss'
import classNames from 'classnames'
import { toShopInfoPage } from '@/utils/page_router'

interface IProps {
  info: object
}

export default class ShopInfoOne extends Component<IProps, {}> {
  props: any

  static options = {
    addGlobalClass: true
  }

  render() {
    const prefixCls = 'shop-info-one'
    const { info={}, className } = this.props
    return (<View className={classNames(prefixCls, className)} onClick={() => toShopInfoPage(info.id)}>
      <Image src={info.logo} className={`${prefixCls}-logo`}/>
      <View className={`${prefixCls}-name t-o-e`}>{info.shopName}</View>
      <View className={`${prefixCls}-more bnn-icon d-f a-i-c`}>
        <Text className={`${prefixCls}-more-text`}>进店逛逛</Text>
        <Text className={`${prefixCls}-more-icon`}>&#xe866;</Text>
      </View>
    </View>)
  }
}
